<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreatePiecesTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_nom}" for="nom" />
                    <h:inputText id="nom" value="#{piecesController.selected.nom}" title="#{bundle.CreatePiecesTitle_nom}" required="true" requiredMessage="#{bundle.CreatePiecesRequiredMessage_nom}"/>
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_dateMiseEnMarche}" for="dateMiseEnMarche" />
                    <h:inputText id="dateMiseEnMarche" value="#{piecesController.selected.dateMiseEnMarche}" title="#{bundle.CreatePiecesTitle_dateMiseEnMarche}" />
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_dureeDeVie}" for="dureeDeVie" />
                    <h:inputText id="dureeDeVie" value="#{piecesController.selected.dureeDeVie}" title="#{bundle.CreatePiecesTitle_dureeDeVie}" />
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_cout}" for="cout" />
                    <h:inputText id="cout" value="#{piecesController.selected.cout}" title="#{bundle.CreatePiecesTitle_cout}" />
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_designation}" for="designation" />
                    <h:inputText id="designation" value="#{piecesController.selected.designation}" title="#{bundle.CreatePiecesTitle_designation}" />
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_identifiantPiece}" for="identifiantPiece" />
                    <h:inputText id="identifiantPiece" value="#{piecesController.selected.identifiantPiece}" title="#{bundle.CreatePiecesTitle_identifiantPiece}" required="true" requiredMessage="#{bundle.CreatePiecesRequiredMessage_identifiantPiece}"/>
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_reference}" for="reference" />
                    <h:inputText id="reference" value="#{piecesController.selected.reference}" title="#{bundle.CreatePiecesTitle_reference}" />
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_idMachine}" for="idMachine" />
                    <h:selectOneMenu id="idMachine" value="#{piecesController.selected.idMachine}" title="#{bundle.CreatePiecesTitle_idMachine}" >
                        <f:selectItems value="#{machineController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreatePiecesLabel_identIntervention}" for="identIntervention" />
                    <h:selectOneMenu id="identIntervention" value="#{piecesController.selected.identIntervention}" title="#{bundle.CreatePiecesTitle_identIntervention}" >
                        <f:selectItems value="#{interventionController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{piecesController.create}" value="#{bundle.CreatePiecesSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{piecesController.prepareList}" value="#{bundle.CreatePiecesShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreatePiecesIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
